UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'J7HfYu43dkXaaLnStAD4gYs/wzhejpvcDRlmAkQzKy0='
WHERE
key_id = '4403c69acfdf609ffc9d4f6de01f0f37f36f2ad2937205ab3886e0e8c768fe2b'
AND (
token = 'J7HfYu43dkXaaLnStAD4gYs/wzhejpvcDRlmAkQzKy0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)