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

Query time 0.00193