UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qeaMy8mG7T1+Fl9P76ESLeHH5B6Bqfgk9G780XAyV3U='
WHERE
key_id = 'fc1ac969a405c199809bb47027dcb756235ee9b327fc71de68159635e97c03b4'
AND (
token = 'qeaMy8mG7T1+Fl9P76ESLeHH5B6Bqfgk9G780XAyV3U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)