UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cMANLKHPvtwQSh9HgkbPXG8CP3bETulO8iq5BB4qAe4='
WHERE
key_id = '7e96a5390d308dc41f4211d4be2dc112e3594b5099dcdee7a2fa202b0b92d4ac'
AND (
token = 'cMANLKHPvtwQSh9HgkbPXG8CP3bETulO8iq5BB4qAe4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)