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