UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pv4xm6C9zxqCWJfCs5gT7zsaoXyUfoi88kwkgnxyReo='
WHERE
key_id = 'e5a42e03c55de3260cb3e75571968411040be5c26c3d189e5fb0c9014e5cb4c9'
AND (
token = 'Pv4xm6C9zxqCWJfCs5gT7zsaoXyUfoi88kwkgnxyReo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)