UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6iFXikAQdh0tGKE7xucBDGWU8XCOQhu7NBCu37Y5mV0='
WHERE
key_id = '889009125bf3e3e08f809ac7040c746ab521aaf36a5e8662d719c0f25b8fca1f'
AND (
token = '6iFXikAQdh0tGKE7xucBDGWU8XCOQhu7NBCu37Y5mV0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)