UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wR1iWMc6kVM/pBbmnpnzyC1nrBHeep0QCtEgOGSLD48=' 
WHERE 
  key_id = '03e47f37fd0ca42103bed76908687fc3aadffe67f3812f047b43e14b12023ca3' 
  AND (
    token = 'wR1iWMc6kVM/pBbmnpnzyC1nrBHeep0QCtEgOGSLD48=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032