UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wkExoCugXDCr5mXQ1EsuMh/5CRFN0QdZgXOjgbL8//4='
WHERE
key_id = '8325580176455f288c15694ea580c16173251592aa427593dc8a78379a796dbe'
AND (
token = 'wkExoCugXDCr5mXQ1EsuMh/5CRFN0QdZgXOjgbL8//4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)