UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EtKzPzDiC2iLC8eXjoPf5fvpoe/9wa9ImOuuDlGQCNE=' 
WHERE 
  key_id = '4434d0616d7d3c5e0175e56bc9cc49fe84171aa479c4783320ec14ef10b67413' 
  AND (
    token = 'EtKzPzDiC2iLC8eXjoPf5fvpoe/9wa9ImOuuDlGQCNE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032