UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yMz39GRcYu2mDk8D6H5Rn4ETnT2YL+fAta70hpRQ3mc='
WHERE
key_id = '764afca56d210bab52548763ee9e2f308cbf781e97b0d02891ae61d101bb5299'
AND (
token = 'yMz39GRcYu2mDk8D6H5Rn4ETnT2YL+fAta70hpRQ3mc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)