UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'drRs5A85z648dL2U/Qg3IrkK/MwMfgK9/wcsiFYL5dA=' 
WHERE 
  key_id = '73977c14d8112fede76e59430a844ee5d1e6952554352cee62546799e47e47c4' 
  AND (
    token = 'drRs5A85z648dL2U/Qg3IrkK/MwMfgK9/wcsiFYL5dA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021