UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YHRZUavk2WZwNW3rvQ0lSiM6uuZoibi3u1ibyWRMBK0='
WHERE
key_id = 'd15ade2038e170265f031624b2fdd0d0efc7f6fa33be984badc11317d4db2b9e'
AND (
token = 'YHRZUavk2WZwNW3rvQ0lSiM6uuZoibi3u1ibyWRMBK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)