UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Nss9+FsuPPcJyjVwikUhbRTs8J7tR2Lo/Oh2gV5cHsI=' 
WHERE 
  key_id = '5f2cb890d82a118760c8d340aa759ce6e1204930a5fe10ed91463dbd77ce962c' 
  AND (
    token = 'Nss9+FsuPPcJyjVwikUhbRTs8J7tR2Lo/Oh2gV5cHsI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049