UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NLDqPmWbK0SWL0PKUEV5zRsHB5DHrOaLOSd68QkxzkI='
WHERE
key_id = '694eafaba8724a4a570619aa1952d7c69f01151fc0ea64034131001fcdda3e57'
AND (
token = 'NLDqPmWbK0SWL0PKUEV5zRsHB5DHrOaLOSd68QkxzkI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)