UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JBVBoy3k7JjqknTGz3OZUvWicIvMbbcdZpeP0a7TQAo='
WHERE
key_id = '3cbbe5007e48aae7d007a3ae6fc72cb7df4a85f6a29188af3e353cf91eb0b5cd'
AND (
token = 'JBVBoy3k7JjqknTGz3OZUvWicIvMbbcdZpeP0a7TQAo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)