UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CbjNIbWv6DUBrj4alh/exSAJ0XppmMdhkAYiwW/PxfM='
WHERE
key_id = 'ebb92ebef951e9e58d0967c5f2fcced56cb589fdfcbbe4c4081edf6c960f832a'
AND (
token = 'CbjNIbWv6DUBrj4alh/exSAJ0XppmMdhkAYiwW/PxfM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)