UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+VAL9tksNXDObTIBEVFGfF7WPVj+szzSmVYDC3Nc3uo=' 
WHERE 
  key_id = '76ca8f6de02aeb4dc96dce75f1506e561e1f531ea09cce3cd5014d38c539747b' 
  AND (
    token = '+VAL9tksNXDObTIBEVFGfF7WPVj+szzSmVYDC3Nc3uo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022