UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BDKNP1ldGODFaqLsS9USIjiGfPGC7dCUEi0FxYaYVsQ='
WHERE
key_id = 'db3e3bd228ab20ac2fd4fc813196a7de6af8a8ec9bcf388c49d483e0001b1839'
AND (
token = 'BDKNP1ldGODFaqLsS9USIjiGfPGC7dCUEi0FxYaYVsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)