UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'x7jfIPmWNxkeaDITL1FIM2PQrXg5EkF5pQQ64YU7/9A='
WHERE
key_id = '5dab9b0b67d06c9600c1b8ccd8e1263ee38aec3a95f7aff4c51db52f7931084d'
AND (
token = 'x7jfIPmWNxkeaDITL1FIM2PQrXg5EkF5pQQ64YU7/9A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)