UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'We2B034CAYevtqqr1F7XZ8RU8HHW+CGkxxE4nDaoZPY='
WHERE
key_id = '660984c2a59a2143d2505a0a30158525cedc80282664292ca1ac8f1dbb0d5fb9'
AND (
token = 'We2B034CAYevtqqr1F7XZ8RU8HHW+CGkxxE4nDaoZPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)