UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YeGMAM+MdMB43r2gREbMg4L5zhWevHfd/eXz4/bkfj4='
WHERE
key_id = 'ad01a98cb25dbd87727475f7bc7fd4250995fe39bfcd574e76514f83e8fb91fd'
AND (
token = 'YeGMAM+MdMB43r2gREbMg4L5zhWevHfd/eXz4/bkfj4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)