UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Tmzv5vzuRXWvWfxLhCJGKmJcbowaQJgZvBQHfJjQr9w='
WHERE
key_id = '3ae7cc414b694eec24bdf4d059e5969ec07a82618e597b0666af491c38aacbc9'
AND (
token = 'Tmzv5vzuRXWvWfxLhCJGKmJcbowaQJgZvBQHfJjQr9w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)