UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q75t8o3VeisnCbjwSDeLVTxV2nvTqmuFZsLKvoprsPE=' 
WHERE 
  key_id = 'bdf46a96ecf60dfdd01ca36977ae209d2f13a29ccebae8669c530522d89bef43' 
  AND (
    token = 'q75t8o3VeisnCbjwSDeLVTxV2nvTqmuFZsLKvoprsPE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027