UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Akj0DgVZl8P+RH9KtdOXRXlOa6iB0x68W5h4P4h0ZCY='
WHERE
key_id = '48cfc4da8b42e18df57e1ccbe4d9b8f3918209860da00492e7b15054e3949dd5'
AND (
token = 'Akj0DgVZl8P+RH9KtdOXRXlOa6iB0x68W5h4P4h0ZCY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)