UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'nxzUq0hhPEOj3KGk05Edm/VnIr78801INaat9nVowbg='
WHERE
key_id = '2c81ac7752669aac7397a67623dab90bd264069f4863d200032625c23c935df4'
AND (
token = 'nxzUq0hhPEOj3KGk05Edm/VnIr78801INaat9nVowbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)