UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xUhY36Rnvuz5YXhQRQVKG52dblQacOXaEOYQgtv/fcM='
WHERE
key_id = 'ec9b89e1f57526046cce6d49504dc4f10909d62f6d71aadbcbf545745f23cdf9'
AND (
token = 'xUhY36Rnvuz5YXhQRQVKG52dblQacOXaEOYQgtv/fcM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)