UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wHPAs/Y9/A/B6Z7tdrIJ++fzUUZ3lXpDXqLLjhIwOTU='
WHERE
key_id = '2a41ee55554e320b06c49a4e55f5119f905396d9f073ffac10cfde3a371a0057'
AND (
token = 'wHPAs/Y9/A/B6Z7tdrIJ++fzUUZ3lXpDXqLLjhIwOTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)