UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nmUudWoKyGKcdA76mv6vUuST2ht8OYz5tgNPzKntDlc=' 
WHERE 
  key_id = '037181141e9ce684068fef3ff689339816de89e435b13d0230a1d43dc2cf44cd' 
  AND (
    token = 'nmUudWoKyGKcdA76mv6vUuST2ht8OYz5tgNPzKntDlc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041