UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ygGIUabDGStAUWDJdm/TZFlwnGSthaf/BqX3Ebr5g9Q='
WHERE
key_id = '2db2ddb6b923c969e89c28856ccbf4b3210260a672ebef87160c17bcca687d05'
AND (
token = 'ygGIUabDGStAUWDJdm/TZFlwnGSthaf/BqX3Ebr5g9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)