UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ObIOLfJD6c+uUYBLFCr0BWeiQRvQ0PQk8NsG6FB4JN4=' 
WHERE 
  key_id = '2ef60c020d9c5e45a32081324b6d6b7306eb6360004e1214f11a9e18f665680a' 
  AND (
    token = 'ObIOLfJD6c+uUYBLFCr0BWeiQRvQ0PQk8NsG6FB4JN4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027