UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KFM/Um4GwyO6Dhb+UQBllPWFvYGoNjeJjkNbQY89xu8='
WHERE
key_id = 'b0493da866d02850562a896dcd0fa61c785302b7d978fea01a8815c4a684ec0c'
AND (
token = 'KFM/Um4GwyO6Dhb+UQBllPWFvYGoNjeJjkNbQY89xu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)