UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kXZaswzTpksKyRyFqExaaM2b1kJSQ9IDbIcrBZN4T6I=' 
WHERE 
  key_id = '86678aa3481060989503e83685d73d621243501e63ca99d15b2ff53f2946a5b7' 
  AND (
    token = 'kXZaswzTpksKyRyFqExaaM2b1kJSQ9IDbIcrBZN4T6I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035