UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WXODkuOEacMp3Sw4t4ZZbe6qvb3CHC17KbKIwe5yYHM='
WHERE
key_id = '57d77159b33fefc3b86486e7d4fade6fe16de4f15c6d2689ff1c27f0115ddd16'
AND (
token = 'WXODkuOEacMp3Sw4t4ZZbe6qvb3CHC17KbKIwe5yYHM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)