UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EWOQyd2kFcC1L6AaMEFz/tgG6i5KvYYi0A7/s1PAA4Q='
WHERE
key_id = 'e71c3e8b651f5ee8b50ab1d24400f77ed2d047b9d0df68ce0fe4930e4764759e'
AND (
token = 'EWOQyd2kFcC1L6AaMEFz/tgG6i5KvYYi0A7/s1PAA4Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)