UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ag1DVAvDoCpCb+YlesyDcI5KHuTX0snB/RLzV/wbQZU='
WHERE
key_id = '3817ec32462cc657e0eb947ffd2ae120825fb749af90337dfceea13ec726a3f1'
AND (
token = 'ag1DVAvDoCpCb+YlesyDcI5KHuTX0snB/RLzV/wbQZU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)