UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0gRm9P3eLt6ZgPCyg3EU37UBaApIrTtie30Pd4tOWmo=' 
WHERE 
  key_id = 'aacc8d625fd1259403bb809e7a527bd2fa9edc53318fd1f9fb39e447da6febd7' 
  AND (
    token = '0gRm9P3eLt6ZgPCyg3EU37UBaApIrTtie30Pd4tOWmo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028